<template>

  <el-dialog title="修改" v-model="visible" width="200px"  append-to-body>
    <el-input-number v-model="num"  controls-position="right" :min="0" @change="numChange"/>
    <template #footer>
      <div class="dialog-footer">
        <el-button type="primary" @click="handleConfirm">确 定</el-button>
        <el-button @click="visible = false">取 消</el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script setup name="NumberEdit">
const emit = defineEmits(["confirm", "num"]);
const { proxy } = getCurrentInstance();
// const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
const visible = ref(false);
const props = defineProps({
  num: {
    type: [Number, String]
  },
});
// 显示弹框
function show() {
  visible.value = true;
}
// 确认
function handleConfirm(){
    emit('confirm',props.num)
    visible.value = false;
   
}
function numChange(e){
    emit('update:num',e)
}
defineExpose({
  show,
});
</script>